package com.vcredit.creditcat.service;

import com.vcredit.creditcat.model.ItemDimension;
import com.vcredit.creditcat.persistence.base.ItemDimensionMapper;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * 
 **/
@Service
public class ItemDimensionService {
	@Autowired
	private ItemDimensionMapper mapper;

	public void insert(ItemDimension obj) {
		mapper.insert(obj);
	}

	@CacheEvict(key = "'config:ItemDimensio*'", value = "itemDimension")
	public void update(ItemDimension obj) {
		mapper.update(obj);
	}

	@Cacheable(key = "'config:ItemDimension'", value = "itemDimension")
	public List<ItemDimension> findAll() {
		return mapper.findAll();
	}

	@SuppressWarnings("unused")
	private List<ItemDimension> find(ItemDimension obj) {
		return mapper.find(obj);
	}
}